var ClubRoomInviteMemberWindow = Window.extend({
    _ccsFileName: res.ClubRoomInviteMemberWindow_json,
    _data: null,
    initWindow: function (data) {
        this._data = data;

        this._nodeList['wanfaInfo'].setVisible(false);
        this._nodeList['inviteInfo.lb_playerName'].setString(this._data['player_name']);
        this._nodeList['inviteInfo.lb_clubName'].setString(this._data['club_name']);
        this._nodeList['inviteInfo.lb_clubRoomId'].setString(this._data['room_id']);
        this._nodeList['inviteInfo.lb_wanfaName'].setString(this._data['wanfa_name']);
        this._nodeList['wanfaInfo.lb_wanfaDesc'].setString(this._data['wanfa_desc']);
        this._nodeList['inviteInfo.lb_wanfaDetail'].setString(this._data['wanfa_desc']);
    },

    _initClickListeners: function () {
        this._clickListeners = {
            'wanfaInfo.btn_back_invite': '_clickBackInvite',
            'inviteInfo.btn_cancel': '_clickCancel',
            'inviteInfo.btn_joinIn': '_clickJoinIn',
            'inviteInfo.lb_wanfaDetail': '_clickDetail',
        }
    },

    _clickCancel: function () {
        var from_uid = this._data['from_uid'];
        var club_id = this._data['club_id'];

        var message = {
            type: MessageType.Refused,
            msg: gameData.nickname + '拒绝了您的邀请',
        };
        var data = {
            club_id: club_id,
            cmd: 'BroadcastUid',
            uids: from_uid.toString(), // uids 必须为字符串
            data: message,
            from_uid: gameData.uid,
        };
        network.send(2103, data);
        this.close();
    },

    _clickBackInvite: function () {
        this._nodeList['wanfaInfo'].setVisible(false);
        this._nodeList['inviteInfo'].setVisible(true);
    },

    _clickDetail: function () {
        this._nodeList['wanfaInfo'].setVisible(true);
        this._nodeList['inviteInfo'].setVisible(false);
    },
    _clickJoinIn: function () {
        clubMsgManager.requestJoinRoom(this._data['room_id']);
    },
});